{extend name="base" /}
{block name="body"}
<div class="layui-card">
    <div class="layui-card-header">{if condition="isset($list.name) "} 编辑请假{else}添加请假{/if}</div>
    <div class="layui-card-body">
        <form action="{:request()->url()}" class="layui-form" method="post">
            <div class="layui-form-item">
                <label class="layui-form-label">姓名</label>
                <div class="layui-input-inline">
                    <input type="hidden" name="id" value="{$data.id|default=''}" >
                    <input type="text" name="name" value="{$data.name|default=''}" autocomplete="off" placeholder="请输入姓名" lay-verify="required" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">* 班级</label>
                <div class="layui-input-inline">
                    <select name="grade_id" lay-verify="required">
                        <option value="0">顶级菜单</option>
                        {foreach name="grade" item="v" empty="$empty"}
                        <option value="{$v.id}"{if condition="isset($data) and $data.grade_id eq $v.id"} selected="selected"{/if}>{$v.title} </option>
                        {/foreach}
                    </select>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">起始时间</label>
                <div class="layui-input-inline">
                    <input type="datetime-local" name="starting_time" value="{$data.starting_time|default=''}" autocomplete="off" placeholder="请输入时间" lay-verify="required" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">起始时间</label>
                <div class="layui-input-inline">
                    <input type="datetime-local" name="finish_time" value="{$data.finish_time|default=''}" autocomplete="off" placeholder="请输入时间" lay-verify="required" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">* 类型</label>
                <div class="layui-input-inline">
                    <input type="radio" name="type" {if condition="isset($data) and $data.type eq 2"} checked="checked"{/if} value="2" >短假<input type="radio" name="type" {if condition="isset($data) and $data.type eq 1"} checked="checked"{/if} value="1" >长假
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">* 状态</label>
                <div class="layui-input-inline">
                    <input type="radio" name="status" {if condition="isset($data) and $data.status eq 1"} checked="checked"{/if} value="1" >启用<input type="radio" name="status" {if condition="isset($data) and $data.status eq 0"} checked="checked"{/if} value="0" >禁用
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">电话</label>
                <div class="layui-input-inline">
                    <input type="text" name="phone" value="{$data.phone|default=''}" autocomplete="off" placeholder="请输入手机号" lay-verify="required|phone" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">理由</label>
                <div class="layui-input-inline">
                  <textarea name="reason">{$data.reason|default=''}</textarea>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-filter="*" lay-submit="">保存</button>
                    <button class="layui-btn layui-btn-primary" type="reset">重置</button>
                </div>
            </div>
        </form>
    </div>
</div>
{/block}
